<link rel="stylesheet" href="<?php echo $base_url; ?>style/css/perfect-scrollbar.css">
<script src="<?php echo $base_url; ?>style/js/FE/jquery-ui.js"></script>
<script src="<?php echo $base_url; ?>style/js/FE/perfect-scrollbar.js"></script>
<script language="javascript" src="<?php echo $img_url; ?>style/js/FE/fe_faq.js"></script>
<style>
    #faq_answer {
        height:500px; 
        padding: 10px; 
        line-height: 25px;
        overflow: hidden;
    }
</style>
<script type="text/javascript">
    $(document).ready(function($) {
        $('#faq_answer').perfectScrollbar();
    });
</script>
<!-- Hoi/Dap -->
<div id="detail-title">
    <span class="title"><?php echo $page_title; ?></span>
    <img src="<?php echo $base_url; ?>style/images/img28.gif">
    <div class="ico-social">
        <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $current_url; ?>&display=popup&ref=plugin" target="_blank"><img src="<?php echo $img_url; ?>style/images/imgfb.gif" width="16" height="16" border="0"></a>
        <a href="https://twitter.com/share" target="_blank"><img src="<?php echo $img_url; ?>style/images/imgtw.gif" width="16" height="16" border="0"></a>
        <a href="https://plus.google.com/share?url=<?php echo $current_url; ?>" target="_blank"><img src="<?php echo $img_url; ?>style/images/imggp.gif" width="16" height="16" border="0"></a>
        <a href="javascript:void(0);" onclick="return openPopup('contactForm')"><img src="<?php echo $img_url; ?>style/images/imgma.gif" width="16" height="16" border="0"></a>
        <a href="javascript:void(0);" onclick="javascript:window.print();"><img src="<?php echo $img_url; ?>style/images/imgpr.gif" width="16" height="16" border="0"></a>

        <span class="time">
            <?php
            //show date time Tieng Viet
            $str_search = array(
                "Mon",
                "Tue",
                "Wed",
                "Thu",
                "Fri",
                "Sat",
                "Sun"
            );
            $str_replace = array(
                "Th&#7913; hai",
                "Th&#7913; ba",
                "Th&#7913; t&#432;",
                "Th&#7913; n&#259;m",
                "Th&#7913; s&#225;u",
                "Th&#7913; b&#7843;y",
                "Ch&#7911; nh&#7853;t"
            );
            $timenow = gmdate("D, d/m/Y | H:i", time() + 7 * 3600);
            $timenow = str_replace($str_search, $str_replace, $timenow);
            echo $timenow;
            ?>      
        </span>
    </div>
</div>  
<div id="seperator"></div>
<!-- details: column -->
<div id="detail-body">
    <div id="faq-search">
        <form name="trueform2" id="trueform2" method="POST" action="<?php echo $base_url; ?>hoi-dap/tim-kiem">
            <input type="text" value="<?php echo $txt_Faq_Keyword; ?>" id="txt_FAQ_Keyword" name="txt_FAQ_Keyword" class="FAQ_Keyword" placeholder="Nhập hỏi đáp cần tìm">
            <input type="text" value="<?php echo $cate_name; ?>" id="txt_FAQ_Cate" name="txt_FAQ_Cate" placeholder=" Chọn chuyên mục" onclick="Faq.toogleCate();" readonly>
            <img src="<?php echo $img_url; ?>style/img/showmore.png" class="buttonShowMore" onclick="Faq.toogleCate();" />
            <input type="hidden" name="isPost" value="1">
            <input type="hidden" name="hidCateId" id="hidCateId" value="<?php echo $cate_id; ?>">
            <input type="hidden" name="h_cur_page" id="h_cur_page" value="1">
            <input type="button" value="Tìm" id="txt_FAQ_Search" name="txt_FAQ_Search" class="FAQ_Search" onClick="return submitSearch('<?php echo $base_url; ?>hoi-dap/tim-kiem', 1);">
        </form>
    </div>
    <!--
    <div id="faq-paging-1">
    <?php echo $paging; ?>
    </div>        
    <br>
    -->
    <br>

    <?php
    if (isset($aFAQ) && count($aFAQ) > 0) {
        $i = $pagesize * ($cur_page - 1) + 1;
        foreach ($aFAQ as $key => $item):
            ?>      
            <div id="seperator2"></div>      
            <div class="cate-item">
                <a id="faq_<?php echo $i; ?>" href="javascript:void(0);" title=""><span class="question">Hỏi <?php echo $i; ?>:</span><span class="question-cate"><?php echo $item->cate_name; ?></span> <?php echo $item->question; ?></a>
                <input type="hidden" id="faq_reply_<?php echo $i; ?>" value="<b>Đáp <?php echo $i; ?></b>: <br><?php echo htmlspecialchars($item->answer); ?>">
                <br>
                <a class="detail" href="javascript:void(0);" onclick="view_FAQ(<?php echo $i; ?>);">Xem trả lời</a>
            </div>      
            <div id="seperator2"></div>
            <?php
            $i++;
        endforeach;
        ?>    
        <div id="faq-paging-wrapper">    
            <div id="faq-paging-1">
                <?php echo $paging; ?>
            </div>     
        </div>
        <?php
    }
    else
        echo "<br><br><div align='center' class='nodata'>Không tìm thấy thông tin " . $page_title . ".</div>";
    ?>
    <script>
    total_faq = <?php echo $i - 1; ?>;
    </script>      
    <div class="clearfix"></div>    
</div>  
<br>
<div class="wrapPopup" id="FAQ_popup" style="display:none;">
    <div class="popup">
        <div class="centerPopup"> 
            <section>
                <header>
                    <img src="<?php echo $img_url; ?>/style/images/img1.jpg"/>
                    <!--<h1>Chia sẻ liên kết qua e-mail</h1>-->
                    <a href="javascript:;" title="Đóng" class="closepp" onclick="closePopup('FAQ_popup')"></a>
                </header>                
            </section>
            <div id="faq_answer">
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>                    
            </div>
        </div>
    </div>
</div>
<div id="faq_cate">
    <?php
    if ($aFAQCate != null && sizeof($aFAQCate) > 0) {
        $itemPerColumn = round(sizeof($aFAQCate) / 2);
        ?>
        <ul class="cate_content">
            <?php for ($i = 0; $i < $itemPerColumn; $i++) { ?>
                <li onclick="Faq.selectCate('<?php echo $aFAQCate[$i]->cate_id; ?>', '<?php echo $aFAQCate[$i]->cate_name; ?>');"><?php echo $aFAQCate[$i]->cate_name; ?></li>
            <?php } ?>
        </ul>
        <ul class="cate_content">
            <?php for ($i = $itemPerColumn; $i < sizeof($aFAQCate); $i++) { ?>
                <li onclick="Faq.selectCate('<?php echo $aFAQCate[$i]->cate_id; ?>', '<?php echo $aFAQCate[$i]->cate_name; ?>');"><?php echo $aFAQCate[$i]->cate_name; ?></li>
            <?php } ?>
        </ul>
    <?php } ?>
    <div class="clearfix"></div>
</div>
